from setuptools import setup, find_packages, Command
import os
import shutil
import glob

class CleanCommand(Command):
    description = 'Clean build directories'
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        dirs_to_clean = ['build', '*.egg-info']
        for dir_pattern in dirs_to_clean:
            for path in glob.glob(dir_pattern):
                if os.path.exists(path):
                    print(f'Removing {path}')
                    if os.path.isdir(path):
                        shutil.rmtree(path)
                    else:
                        os.remove(path)

setup(
    name='paddleocr',
    version='0.1.0',
    packages=find_packages(),
    include_package_data=True,
    # package_data={
    #     'ocr_onnx': ['det/model.onnx', 'rec/model.onnx', 'ppocr_keys_v1.txt']
    # },
    description='OCR tool using ONNX runtime',
    author='Author',
    author_email='author@example.com',
    url='https://github.com/author/ocr_onnx',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
    ],
    # cmdclass={
    #     'clean': CleanCommand,
    # },
)